# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=usbredir
pkgver=0.14.0
pkgrel=0
pkgdesc="USB network redirection protocol libraries"
url="https://www.spice-space.org/usbredir.html"
arch="all"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
makedepends="libusb-dev meson glib-dev"
subpackages="
	$pkgname-dev
	$pkgname-doc
	libusbredirhost
	libusbredirparser
	"
source="https://www.spice-space.org/download/usbredir/usbredir-$pkgver.tar.xz"

# secfixes:
#   0.12.0-r0:
#     - CVE-2021-3700

build() {
	abuild-meson -Db_lto=true . output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

libusbredirhost() {
	amove usr/lib/libusbredirhost.so.*
}

libusbredirparser() {
	amove usr/lib/libusbredirparser.so.*
}

sha512sums="
8e8e8f1cdcf2285ebe24d45dac4d85f7ebe884bad890ffca51b963bfeb51cc26325d1029d0863fb14b925e9919858babdde2a509d570c0a8515bbe7f4dda94e4  usbredir-0.14.0.tar.xz
"
